@@ -4,16 +4,6 @@ |
||
| 4 | 4 |
# periodically propagating and expiring Events. It also running TwitterStreamAgents and Agents that support long running |
| 5 | 5 |
# background jobs. |
| 6 | 6 |
|
| 7 |
-Dotenv.load if Rails.env == 'development' |
|
| 8 |
- |
|
| 9 |
-require 'agent_runner' |
|
| 10 |
- |
|
| 11 |
-unless defined?(Rails) |
|
| 12 |
- puts |
|
| 13 |
- puts "Please run me with rails runner, for example:" |
|
| 14 |
- puts " RAILS_ENV=production bundle exec rails runner bin/agent_runner.rb" |
|
| 15 |
- puts |
|
| 16 |
- exit 1 |
|
| 17 |
-end |
|
| 7 |
+require_relative './pre_runner_boot' |
|
| 18 | 8 |
|
| 19 | 9 |
AgentRunner.new(except: DelayedJobWorker).run |
@@ -0,0 +1,13 @@ |
||
| 1 |
+unless defined?(Rails) |
|
| 2 |
+ puts |
|
| 3 |
+ puts "Please run me with rails runner, for example:" |
|
| 4 |
+ puts " RAILS_ENV=production bundle exec rails runner bin/#{File.basename($0)}"
|
|
| 5 |
+ puts |
|
| 6 |
+ exit 1 |
|
| 7 |
+end |
|
| 8 |
+ |
|
| 9 |
+Rails.configuration.cache_classes = true |
|
| 10 |
+ |
|
| 11 |
+Dotenv.load if ENV['APP_SECRET_TOKEN'].blank? |
|
| 12 |
+ |
|
| 13 |
+require 'agent_runner' |
@@ -3,16 +3,6 @@ |
||
| 3 | 3 |
# This process is used to maintain Huginn's upkeep behavior, automatically running scheduled Agents and |
| 4 | 4 |
# periodically propagating and expiring Events. It's typically run via foreman and the included Procfile. |
| 5 | 5 |
|
| 6 |
-Dotenv.load if Rails.env == 'development' |
|
| 7 |
- |
|
| 8 |
-require 'agent_runner' |
|
| 9 |
- |
|
| 10 |
-unless defined?(Rails) |
|
| 11 |
- puts |
|
| 12 |
- puts "Please run me with rails runner, for example:" |
|
| 13 |
- puts " RAILS_ENV=production bundle exec rails runner bin/schedule.rb" |
|
| 14 |
- puts |
|
| 15 |
- exit 1 |
|
| 16 |
-end |
|
| 6 |
+require_relative './pre_runner_boot' |
|
| 17 | 7 |
|
| 18 | 8 |
AgentRunner.new(only: HuginnScheduler).run |
@@ -1,16 +1,6 @@ |
||
| 1 | 1 |
#!/usr/bin/env ruby |
| 2 | 2 |
|
| 3 |
-Dotenv.load if Rails.env == 'development' |
|
| 4 |
- |
|
| 5 |
-require 'agent_runner' |
|
| 6 |
- |
|
| 7 |
-unless defined?(Rails) |
|
| 8 |
- puts |
|
| 9 |
- puts "Please run me with rails runner, for example:" |
|
| 10 |
- puts " RAILS_ENV=production bundle exec rails runner bin/threaded.rb" |
|
| 11 |
- puts |
|
| 12 |
- exit 1 |
|
| 13 |
-end |
|
| 3 |
+require_relative './pre_runner_boot' |
|
| 14 | 4 |
|
| 15 | 5 |
agent_runner = AgentRunner.new |
| 16 | 6 |
|
@@ -4,16 +4,6 @@ |
||
| 4 | 4 |
# new or changed TwitterStreamAgents and starts to follow the stream for them. It is typically run by foreman via |
| 5 | 5 |
# the included Procfile. |
| 6 | 6 |
|
| 7 |
-Dotenv.load if Rails.env == 'development' |
|
| 8 |
- |
|
| 9 |
-require 'agent_runner' |
|
| 10 |
- |
|
| 11 |
-unless defined?(Rails) |
|
| 12 |
- puts |
|
| 13 |
- puts "Please run me with rails runner, for example:" |
|
| 14 |
- puts " RAILS_ENV=production bundle exec rails runner bin/twitter_stream.rb" |
|
| 15 |
- puts |
|
| 16 |
- exit 1 |
|
| 17 |
-end |
|
| 7 |
+require_relative './pre_runner_boot' |
|
| 18 | 8 |
|
| 19 | 9 |
AgentRunner.new(only: Agents::TwitterStreamAgent).run |
@@ -4,8 +4,6 @@ require 'rufus-scheduler' |
||
| 4 | 4 |
require 'pp' |
| 5 | 5 |
require 'twitter' |
| 6 | 6 |
|
| 7 |
-Rails.configuration.cache_classes = true |
|
| 8 |
- |
|
| 9 | 7 |
class AgentRunner |
| 10 | 8 |
@@agents = [] |
| 11 | 9 |
|